package com.sth.deadLock;

public class Lock2 implements Runnable {
    @Override
    public void run() {
        try {
            System.out.println("Lock2 ruuing");
            synchronized (Lock2.class) {
                System.out.println("Lock2 lock obj");
                Thread.sleep(3000);
                synchronized (Lock1.class) {
                    System.out.println("Lock1 lock obj2");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
